#ifndef STDAFXH
#define STDAFXH

#ifdef WIN32
#include "targetver.h"
#include <tchar.h>
#endif

#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <unordered_map>

// Namespaces
using namespace std;
// Macros
#define safeDelete(A) if(A != NULL) {delete A; A=NULL;}
#define TODO throw "Not implemented yet";

// Definition des types
enum Fonction
{
  LNOT, LOR, LAND, LXOR, LREGI, LREGO, LTRUE, LFALSE, IN, LRAM, LROM,LRAMO,LROMO
};

enum TypeAffichage
{
	trace, display, nothing
};



struct Variable
{
Variable(bool v,bool vs):valeur(v),valeurSuivante(vs){valeur=false;valeurSuivante=false;}
  unsigned int valeur;
  bool valeurSuivante;
  bool doWrite;
  Fonction fun;
  vector<int> args;
  unsigned int toRam;
  unsigned int toAddr;
  unsigned   int multA,multV;
  TypeAffichage affichage;
  string name;
};

// Declaration des fonctions
bool ReadFile(const char* filename, vector<Variable>& vars,vector<int>& a,vector<int>& b);
void getIn(const char* filename,vector< vector<bool> >&vars,unordered_map<string,int>& a);
void NextStep(vector<Variable>& vars,vector<bool>& entree,unordered_map<string,int>& a,vector<int> &b,vector<int> &d,vector<int> &f);
void loadProg(string a);
void updateTime();
#endif
